package com.atguigu2.two.exer1;

/**
 * ClassName: ArrayExer01
 * Package: com.atguigu2.two.exer1
 * Description:
 *
 案例1：获取arr数组中所有元素的和。

 提示：使用for的嵌套循环即可。
 * @Author xiao_qi
 * @Create 2024/3/13 23:12
 * @Version 1.0
 */
public class ArrayExer01 {
    public static void main(String[] args){
        int [][] array01=new int[][]{{3,5,8},{12,9},{7,0,6,4}};
        int sum = 0;
        for (int i = 0; i < array01.length; i++) {
            for (int j = 0; j <array01[i].length ; j++) {
                sum += array01[i][j];
            }
        }
        System.out.println("总数为 :" + sum);
    }
}
